<!doctype html>
<html>
<head>
    <meta charset="utf-8">
    <title>微信小程序配置</title>
    {template 'stourtravel/public/public_js'}
    {php echo Common::getCss('style.css,base.css,base_new.css'); }
    {php echo Common::getScript("uploadify/jquery.uploadify.min.js,product_add.js,choose.js,imageup.js,DatePicker/WdatePicker.js"); }
    <script type="text/javascript" src="/newtravel/public/js/config.js"></script>

<body>
<table class="content-tab">
    <tr>
        <td width="119px" class="content-lt-td"  valign="top">
            {template 'stourtravel/public/leftnav'}
            <!--右侧内容区-->
        </td>
        <td valign="top" class="content-rt-td">
            <form id="configfrm">
                <div class="w-set-con">
                    <div class="cfg-header-bar">
                        <a href="javascript:;" class="fr btn btn-primary radius mt-6 mr-10" onclick="window.location.reload()">刷新</a>
                    </div>

                    <div class="w-set-nr">
                        <div class="picture ml-10">
                            <ul class="info-item-block">
                                <li>
                                    <span class="item-hd" style="width: 140px !important;">APPID{Common::get_help_icon('cfg_global_client_appkey')}:</span>
                                    <div class="item-bd" style="padding-left: 145px !important;">
                                        <input type="text" name="cfg_global_client_appkey" id="cfg_global_client_appkey" class="input-text w300" >
                                    </div>
                                </li>
                                <li>
                                    <span class="item-hd" style="width: 140px !important;">AppSecret{Common::get_help_icon('cfg_global_client_appsecret')}:</span>
                                    <div class="item-bd" style="padding-left: 145px !important;">
                                        <input type="text" name="cfg_global_client_appsecret" id="cfg_global_client_appsecret" class="input-text w300">
                                    </div>
                                </li>
                            </ul>

                        </div>
                        <div class="clear clearfix mt-10">
                            <a class="btn btn-primary radius size-L ml-115" href="javascript:;" id="btn_save">保存</a>
                            <input type="hidden" name="webid" id="webid" value="0">
                        </div>


                    </div>
                </div>
            </form>
        </td>
    </tr>
</table>



<script>
    $(document).ready(function(){
        //配置信息保存
        $("#btn_save").click(function(){
            var webid= 0;
            Config.saveConfig(webid);
        });
        getConfig(0);
    });


    //获取配置
    function getConfig(webid)
    {
        Config.getConfig(webid,function(data){
            $("#cfg_global_client_appkey").val(data.cfg_global_client_appkey);
            $("#cfg_global_client_appsecret").val(data.cfg_global_client_appsecret);
        })
    }

</script>

</body>
</html>
